#pragma once

#include "e2d/core/Inst.h"

#include "fxcc/imgui/Layer.h"
#include "fxcc/core/Cache.h"
#include "fxcc/yml/Serializer.h"

#include "e2d/ui/HierarchyEditor.h"
#include "e2d/ui/SceneTreeNodeEditor.h"
#include "e2d/ui/GraphEditor.h"
#include "e2d/ui/CustumFileSystemLayer.h"
#include "e2d/ui/GameLayer.h"
#include "e2d/ui/LoggerLayer.h"
#include "e2d/ui/ActorEditor.h"
#include "e2d/ui/MaterialEditor.h"
#include "e2d/ui/EffectsEditor.h"

#include "sysx/System.h"

#include <thread>
#include <chrono>

#include "e2d/yml/impl/FinalSerializer.h"
#include "e2d/imgui/impl/FinalEditor.h"

namespace e2d
{

	struct Layout
	{
		
		std::vector<std::shared_ptr<fxcc::imgui::Layer>> m_Layers;

		std::shared_ptr<e2d::HierarchyEditor> m_HierarchyEditor;

		std::shared_ptr<e2d::GraphEditor> m_GraphEditor;

		std::shared_ptr<e2d::GameLayer> m_GameLayer;
		
		std::shared_ptr<e2d::SceneTreeNodeEditor> m_SceneTreeNodeEditor;
		
		std::shared_ptr<e2d::CustumFileSystemLayer> m_CustumFileSystemLayer;

		std::shared_ptr<e2d::LoggerLayer> m_LoggerLayer;

		std::shared_ptr<e2d::ActorEditor> m_ActorEditor;

		std::shared_ptr<e2d::MaterialEditor> m_MaterialEditor;
		
		std::shared_ptr<e2d::EffectsEditor> m_EffectsEditor;

		Layout();

		void Inst();
		
		void Handle();
		
		void View();
		
		void SetScene(std::shared_ptr<e2d::Scene> scene);

		void NewInstance();

		void OnMainMenuBar();
		
		void OnDestroy();

		void OnSave();
		
		void OnSaveAs();

		void OnSaveData();

		void OnLoad();

		void OnLoadData(const std::string& path);
		

	private:
		sysx::System::Filters filters;

	};
}
